<?php slot('pageIntro') ?>

<!-- begin intro -->
<div class="intro_text">
    <div class="intro_content">
        <h4 style="text-align: center;">
            <?php echo $questionaire[0]->getName() ?>
        </h4>
    </div>  	  
</div>
<!-- end intro --> 
<?php end_slot() ?>

<?php if($total_answers <= $count_answers): ?>
  <?php slot('clientsForm') ?>
  <?php use_stylesheet('/project_css_js/tofsla_forms.css') ?>
  <?php use_javascript('/project_css_js/js/tofsla_forms.js') ?>
  <?php use_javascript('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js') ?>
  <?php use_stylesheet('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/base/jquery-ui.css') ?>

  <?php $flash = $sf_user->getFlash('notice'); ?>
  <?php if (!empty($flash)): ?>
      <div id="flash"><?php echo $flash."<br />"; ?></div>
  <?php endif; ?>    <?php if(!$sf_request->getCookie('__uinternal')): ?>
      <form class="user_form" action="<?php echo LinkGen::getInstance(LinkGen::STRUCTURE)->link($node->getId()) ?>" method="post">
      <?php echo $form->renderHiddenFields(true); ?>
      <!-- begin two third last -->
      <div class="columns two_third last">
          <?php echo $form['questions']->render(); ?>
      </div>
      <!-- end two third last -->

      <!-- begin one third -->
      <div class="columns one_third">
          <?php echo $form['user_info'] ?>
          <input class="empty_form" style="float:left;margin-top:5px;" type="submit" value="<?php echo __('Tühista') ?>" />
          <input style="float:right;margin-top:5px;" type="submit" value="<?php echo __('Salvesta') ?>" />
      </div>
      <!-- end one third -->
      <input type="hidden" name="questionaire_id" value="<?php echo $questionaire[0]->getId() ?>" />
  </form>  
 
  <?php include_partial('clientsFormWidget/address_search_js') ?>    
  <script type="text/javascript">   
      $('.empty_form').click(function() {                if(confirm('<?php echo __("Are you sure?") ?>')) {          $('.user_form')[0].reset();          $('.tfChecked').removeClass('tfChecked');        }      
               
         return false;      
      });
  </script> <?php endif ?>
<?php end_slot() ?>
<?php else: ?>
  <?php slot('clientsForm') ?>
    
    <script type="text/javascript">
      alert('<?php echo __("Nobody cannot answer anymore (limit exhausted)") ?>');
    </script>
    
  <?php end_slot() ?>
<?php endif ?>